#include <stdio.h>

struct student
{
    char id[10], name[8];  /* 学号、姓名 */
    int final, midterm, aver;   /* 期末、期中、平均成绩 */
};

void main()
{
    // 定义结构本变量及指针
    struct student std, *p;
    p=&std;
    printf("请输入学号、姓名、期末、期中成绩：\n");
    scanf("%s%s%d%d", std.id, std.name, &std.final, &std.midterm);
    (*p).aver=((*p).final + (*p).midterm)/2;
    printf("您输入的数据如下：\n");
    printf("id:%-10s, name:%-10s\n", std.id, std.name);
    printf("final score:%d\tmidterm score:%d\taverage score:%d\n", 
    p->final, p->midterm, p->aver);
}
